package com.zhonghan.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class RechargeOrderId {

	public static void main(String[] args) {
		
/*		Random random = new Random();  
        int randint =(int)Math.floor((random.nextDouble()*100000.0));   //产生0-10000之间随机数          
*/      
		Random random = new Random();

	    int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数
		System.out.println(rannum);
	}
	
	
	public static String getOrderId() {
		StringBuilder strBuilder = new StringBuilder();
		strBuilder.append("ZHY");
		strBuilder.append((new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())));
		
		//产生随机数据，写入文件  
		Random random = new Random();  
        int randint =(int)Math.floor((random.nextDouble()*100000.0));   //产生0-10000之间随机数          
        strBuilder.append(randint);
         
		
        return strBuilder.toString();
	}
	public static String getOrderIdII(String card) {
		StringBuilder strBuilder = new StringBuilder();
		strBuilder.append("ZHY");
		strBuilder.append(card);
		//产生随机数据，写入文件  
		Random random = new Random();  
		int randint = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数 
        strBuilder.append(randint);
        return strBuilder.toString();
	}
	/**
	 * 大客户
	 * @return
	 */
	public static String getOrderIdBigCustomer() {
		StringBuilder strBuilder = new StringBuilder();
		strBuilder.append("ZHYBC");
		strBuilder.append((new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())));
		
		//产生随机数据，写入文件  
		Random random = new Random();  
		int randint = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数 
        strBuilder.append(randint);
        return strBuilder.toString();
	}
	public static String getOrderIdJiSu(String card,Integer cardStatus) {
		StringBuilder strBuilder = new StringBuilder();
		strBuilder.append("ZHYJISU");
		strBuilder.append(card);
		if(cardStatus == 1) {
			//产生随机数据，写入文件  
			Random random = new Random();  
			int randint = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数 
	        strBuilder.append(randint);
		}
		
        return strBuilder.toString();
	}
}
